import { createRouter, createWebHashHistory } from 'vue-router'
import Layout from '../view/Layout.vue'
import Article from '../view/Article.vue'
import Main from '../view/Main.vue'
import AboutMe from '../view/AboutMe.vue'
import Archive from '../view/Archive.vue'
import SendMessage from '../view/SendMessage.vue'
import Login from '../view/Login.vue'
import Manager from '../view/Manager.vue'
import EditEssay from '../view/EditEssay.vue'


import Account from '../view/manage/Account.vue'
import Essay from '../view/manage/Essay.vue'
import Message from '../view/manage/message.vue'
import Visitor from '../view/manage/Visitor.vue'
const router = createRouter({
  history: createWebHashHistory(),
  routes: [{
    path: '/', redirect: '/home',
    component: Layout,
    children: [
      {
        path: '/home',
        component: Main
      },
      {
        path: '/article',
        component: Article
      }, {
        path: '/about',
        component: AboutMe
      }, {
        path: '/archive',
        component: Archive
      }, {
        path: '/message',
        component: SendMessage
      }, {
        path: '/login',
        component: Login
      }, {
        path: '/edit',
        component: EditEssay
      },
      
      {
        path: '/manage',
        component: Manager,
        children: [{
          path: '/manage/account',
          component: Account
        }, {
          path: '/manage/essay',
          component: Essay
        }, {
          path: '/manage/message',
          component: Message
        }, {
          path: '/manage/visitor',
          component: Visitor
        }

        ]
      }
    ]
  }
  ],
})
export default router;